#include "character.h"

Character::Character(Vector3f charColor) : position(Vector3f(0,0,0)), lookAt(Vector3f(0,0,1)), color(charColor) {
}

void Character::setColor(Vector3f charColor) {
	color = charColor;
}

Vector3f Character::getColor() {
	return color;
}

void Character::setPosition(Vector3f pos) {
	position = pos;
}

Vector3f Character::getPosition() {
	return position;
}

void Character::setLookAt(Vector3f lookat) {
	lookAt = lookat;
}

Vector3f Character::getLookAt() {
	return lookAt;
}

void Character::move(Vector3f displacement) {
	position = position + displacement;
}

void Character::rotate(const double degrees) {
	Quaternion q(Vector3f(0, 1, 0), degrees);
	lookAt = q.rotate(lookAt);
}

void Character::draw() {
	glColor3f(color.getX(), color.getY(), color.getZ());
	glutSolidSphere(0.2, 16, 16);
}
